﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Wanted.aspx.cs" Inherits="Wanted" MasterPageFile="~/MasterPage.master" %>

<asp:Content ID="content1" runat="server" ContentPlaceHolderID="MainContentPlaceHolder">
    <div style="height: 484px">
    
    <div style="text-align: center">
      <table border="0" cellspacing="0" cellpadding="0" 
            style="background-color:#ffffff; width: 1225px;">
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>
              <table cellpadding="0" cellspacing="0" 
                  
                  style="width: 1205px; vertical-align: top; background-color: #C0C0C0; height: 477px;">
                  <tr>
                                <td>
                                    <table cellpadding="0" cellspacing="0" 
                                        style="width: 990px; background-color: #FFFFCC; height: 385px;">
                                        <tr>
                                            <td colspan="2">
                                                <asp:Label ID="Label1" runat="server" BackColor="#666699" ForeColor="White" 
                                                    SkinID="Label2" style="font-weight: 700; font-style: italic; font-size: large; margin-left: 379px;" 
                                                    Text="Wanted Details" Width="196px"></asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style3">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style3" align="center">

                                                <asp:DetailsView ID="DetailsView2" runat="server" AllowPaging="True" 
                                                    AutoGenerateRows="False" CellPadding="4" DataKeyNames="Price" 
                                                    DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" 
                                                    Height="399px" Width="274px">
                                                    <AlternatingRowStyle BackColor="White" />
                                                    <CommandRowStyle BackColor="#FFFFC0" Font-Bold="True" />
                                                    <FieldHeaderStyle BackColor="#FFFF99" Font-Bold="True" />
                                                    <Fields>
                                                        <asp:BoundField DataField="FName" HeaderText="First Name" 
                                                            SortExpression="FName" />
                                                        <asp:BoundField DataField="LName" HeaderText="Last Name" 
                                                            SortExpression="LName" />
                                                        <asp:BoundField DataField="Crime" HeaderText="Crime Committed" 
                                                            SortExpression="Crime" />
                                                        <asp:BoundField DataField="Price" HeaderText="Reward" ReadOnly="True" 
                                                            SortExpression="Price" />
                                                        <asp:BoundField DataField="Location" HeaderText="Location" 
                                                            SortExpression="Location" />
                                                        <asp:BoundField DataField="Alias" HeaderText="Alias" SortExpression="Alias" />
                                                        <asp:CommandField 
                                                            ShowInsertButton="True" />
                                                    </Fields>
                                                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                                                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                                                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                                                </asp:DetailsView>
                                            </td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style3">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style3">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                        <tr>
                                            <td class="style3">
                                                &nbsp;</td>
                                            <td>
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
            </td>
        </tr>
        </table>
    </div>

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PAS_DB %>" 
            DeleteCommand="DELETE FROM [Wanted] WHERE [Price] = @Price" 
            InsertCommand="INSERT INTO [Wanted] ([FName], [LName], [Crime], [Price], [Location]) VALUES (@FName, @LName, @Crime, @Price, @Location)" 
            SelectCommand="SELECT * FROM [Wanted]" 
            UpdateCommand="UPDATE [Wanted] SET [FName] = @FName, [LName] = @LName, [Crime] = @Crime, [Location] = @Location WHERE [Price] = @Price">
            <DeleteParameters>
                <asp:Parameter Name="Price" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="FName" Type="String" />
                <asp:Parameter Name="LName" Type="String" />
                <asp:Parameter Name="Crime" Type="String" />
                <asp:Parameter Name="Price" Type="Int32" />
                <asp:Parameter Name="Location" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="FName" Type="String" />
                <asp:Parameter Name="LName" Type="String" />
                <asp:Parameter Name="Crime" Type="String" />
                <asp:Parameter Name="Location" Type="String" />
                <asp:Parameter Name="Price" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
    
    </div>
</asp:Content>
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">
    <style type="text/css">
        .style2
        {
            width: 274px;
        }
    </style>
</asp:Content>
